package com.example.demo.mapper;


import com.example.demo.entity.user.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface LogMapper {
//
//    @Select("SELECT * FROM public.sys_user WHERE name = #{name} AND password = #{password}")
//    public List<UserInfo> login(String name, String password);


    @Select("SELECT public.sys_user.*, public.sys_role.name as user_role FROM public.sys_user LEFT JOIN public.sys_role ON public.sys_user.type = public.sys_role.id WHERE public.sys_user.name = #{name} AND public.sys_user.password = #{password};")
    public List<UserInfo> login(String name, String password);
}
